
module.exports = function (engine) {
  engine.registerFilter("get_array_values", (item, key) => {
      if (item && item.length) {
          return item.map((item) => item[key]);
      }
      return [];
  });

  engine.registerFilter("image_url", (item) => {
      return item;
  });

  engine.registerFilter("json", (item) => {
      return item?JSON.stringify(item):'[]';
  });

  

  engine.registerFilter("asset_abs_url", (item) => {
      return "https://shopyy.oemsaas.cn/theme/default/assets/" + item;
  });
  engine.registerFilter("asset_abs_dir_url", (item) => {
    return "https://shopyy.oemsaas.cn/theme/default/assets/" + item;
});

  engine.registerFilter("money", (item) => {
      return "$" + item;
  });

  
  engine.registerFilter("public_asset_abs_url", (item) => {
    return "https://shopyy.oemsaas.cn/theme/default/assets/" + item;
});
engine.registerFilter("public_asset_abs_dir_url", (item) => {
    return "https://shopyy.oemsaas.cn/theme/default/assets/" + item;
});
};
